using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Wiki_List -  维基 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class IWikiList<T> :ModelBase<WikiList> where T : WikiList, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.WikiId = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return WikiId;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.WikiId=dy.WikiId;
           this.Title=dy.Title;
           this.UserId=dy.UserId;
           this.VerId=dy.VerId;
           this.PathId=dy.PathId;
           this.SubmitTime=dy.SubmitTime;
           this.IsLock=dy.IsLock;
           this.Status=dy.Status;
           this.EidtCount=dy.EidtCount;
           this.Sno=dy.Sno;
        } 

        #region 定义属性

     
         /// <summary>
        /// 维基ID
        /// </summary>
        private String _WikiId = "";
      
        /// <summary>
        /// 维基ID
        /// </summary>
        public String WikiId
        {
            get 
            {
              return   (this._WikiId); 
            }

            set 
            {
                    _WikiId= value;  
            }
        }
       
     
         /// <summary>
        /// 标题
        /// </summary>
        private String _Title = "";
      
        /// <summary>
        /// 标题
        /// </summary>
        public String Title
        {
            get 
            {
              return   (this._Title); 
            }

            set 
            {
                    _Title= value;  
            }
        }
       
     
         /// <summary>
        /// 用户ID
        /// </summary>
        private String _UserId = "";
      
        /// <summary>
        /// 用户ID
        /// </summary>
        public String UserId
        {
            get 
            {
              return   (this._UserId); 
            }

            set 
            {
                    _UserId= value;  
            }
        }
       
     
         /// <summary>
        /// 当前版本ID
        /// </summary>
        private String _VerId = "";
      
        /// <summary>
        /// 当前版本ID
        /// </summary>
        public String VerId
        {
            get 
            {
              return   (this._VerId); 
            }

            set 
            {
                    _VerId= value;  
            }
        }
       
     
         /// <summary>
        /// 所属索引ID
        /// </summary>
        private String _PathId = "";
      
        /// <summary>
        /// 所属索引ID
        /// </summary>
        public String PathId
        {
            get 
            {
              return   (this._PathId); 
            }

            set 
            {
                    _PathId= value;  
            }
        }
       
     
         /// <summary>
        /// 创建时间
        /// </summary>
        private DateTime _SubmitTime =DateTime.MinValue;
      
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime SubmitTime
        {
            get 
            {
              return   (this._SubmitTime); 
            }

            set 
            {
                    _SubmitTime= value;  
            }
        }
       
     
         /// <summary>
        /// 是否锁定
        /// </summary>
        private int _IsLock =-1;
      
        /// <summary>
        /// 是否锁定
        /// </summary>
        public yq.Enums.BooleanType IsLock
        {
            get 
            {
              return  (yq.Enums.BooleanType)_IsLock; 
            }

            set 
            {
                    _IsLock= value.GetHashCode(); 
            }
        }
       
     
         /// <summary>
        /// 状态
        /// </summary>
        private int _Status =int.MinValue;
      
        /// <summary>
        /// 状态
        /// </summary>
        public int Status
        {
            get 
            {
              return   (this._Status); 
            }

            set 
            {
                    _Status= value;  
            }
        }
       
     
         /// <summary>
        /// 编辑次数
        /// </summary>
        private int _EidtCount =int.MinValue;
      
        /// <summary>
        /// 编辑次数
        /// </summary>
        public int EidtCount
        {
            get 
            {
              return   (this._EidtCount); 
            }

            set 
            {
                    _EidtCount= value;  
            }
        }
       
     
         /// <summary>
        /// Sno
        /// </summary>
        private int _Sno =int.MinValue;
      
        /// <summary>
        /// Sno
        /// </summary>
        public int Sno
        {
            get 
            {
              return   (this._Sno); 
            }

            set 
            {
                    _Sno= value;  
            }
        }
       

      #endregion 定义属性 

          protected internal override void SetValue(WikiList info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["WikiId"]!= DBNull.Value)
                  {
                  info.WikiId=row["WikiId"].ToString();
                 }
                 
                  
                  if(row["Title"]!= DBNull.Value)
                  {
                  info.Title=row["Title"].ToString();
                 }
                 
                  
                  if(row["UserId"]!= DBNull.Value)
                  {
                  info.UserId=row["UserId"].ToString();
                 }
                 
                  
                  if(row["VerId"]!= DBNull.Value)
                  {
                  info.VerId=row["VerId"].ToString();
                 }
                 
                  
                  if(row["PathId"]!= DBNull.Value)
                  {
                  info.PathId=row["PathId"].ToString();
                 }
                 
                  
                  if(row["SubmitTime"]!= DBNull.Value)
                  {
                  info.SubmitTime=Convert.ToDateTime(row["SubmitTime"]);
                 }
                 
                  
                  if(row["IsLock"]!= DBNull.Value)
                  {
                  info.IsLock= (yq.Enums.BooleanType)(row["IsLock"]) ;
                 }
                 
                  
                  if(row["Status"]!= DBNull.Value)
                  {
                  info.Status=Convert.ToInt32(row["Status"]);
                 }
                 
                  
                  if(row["EidtCount"]!= DBNull.Value)
                  {
                  info.EidtCount=Convert.ToInt32(row["EidtCount"]);
                 }
                 
                  
                  if(row["Sno"]!= DBNull.Value)
                  {
                  info.Sno=Convert.ToInt32(row["Sno"]);
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, WikiList info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@WikiId", DbType.String,ParameterTool.GetObj( info._WikiId )); 
            
             
                cn.AddInParameter(comm, "@Title", DbType.String,ParameterTool.GetObj( info._Title )); 
            
             
                cn.AddInParameter(comm, "@UserId", DbType.String,ParameterTool.GetObj( info._UserId )); 
            
             
                cn.AddInParameter(comm, "@VerId", DbType.String,ParameterTool.GetObj( info._VerId )); 
            
             
                cn.AddInParameter(comm, "@PathId", DbType.String,ParameterTool.GetObj( info._PathId )); 
            
             
                cn.AddInParameter(comm, "@SubmitTime", DbType.DateTime,ParameterTool.GetObj( info._SubmitTime )); 
            
             
                cn.AddInParameter(comm, "@IsLock", DbType.Int32,ParameterTool.GetObj( info._IsLock )); 
            
             
                cn.AddInParameter(comm, "@Status", DbType.Int32,ParameterTool.GetObj( info._Status )); 
            
             
                cn.AddInParameter(comm, "@EidtCount", DbType.Int32,ParameterTool.GetObj( info._EidtCount )); 
            
             
                cn.AddInParameter(comm, "@Sno", DbType.Int32,ParameterTool.GetObj( info._Sno )); 
            
        } 

    } 
} 